IS_GW=`cat config/gw_setup.conf | awk ' { print $2 } ' `
LAN_IF=`cat config/lan_setup.conf | awk ' { print $2 } '`
LAN_IP=`cat config/lan_setup.conf | awk ' { print $3 } '`
WAN_IF=`cat config/wan_setup.conf | awk ' { print $2 } '`

if [ "$IS_GW" = "yes" ]; then

        echo "Configuring gateway...this might take some time.. "
	BUFFER=`ifconfig $WAN_IF | grep "inet addr" | awk '{ print $2 }' `
	WAN_IP=${BUFFER:5}
        bash ./firewall/flush_all.sh
        bash ./firewall/fwd_all.sh $WAN_IF $WAN_IP $LAN_IF $LAN_IP 24
	echo "Gateway configured successfully!!"
fi

